package com.hdit.utils
{
	
	import mx.collections.ArrayCollection;
	
	import de.polygonal.ds.Array2;

	public class ArrayUtils
	{
		public function ArrayUtils()
		{
		}
		/**
		 * 判断对象是否为ArrayCollection不是则转为ArrayCollection
		 **/
		public static function excute(obj:*):ArrayCollection
		{
			var arr:ArrayCollection=new ArrayCollection();
			if(obj as ArrayCollection)
				arr=obj;
			else
				arr.addItem(obj);
			return arr;
		}
		public static function clone(originalList:Array,newItem:*):Array
		{
			var newInstance:Array=new Array();
			for (var i:int = 0; i < originalList.length; i++) 
			{
				newInstance.push(originalList[i]);
			}
			newInstance.push(newItem);
			return newInstance;
			
		}
	}
}